package com.heima.leadnews.article.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.heima.leadnews.article.mapper.ApArticleConfigMapper;
import com.heima.leadnews.article.service.ApArticleConfigService;
import com.heima.model.article.pojos.ApArticleConfig;
import org.springframework.stereotype.Service;

import java.util.Map;
@Service
public class ApArticleConfigServiceImpl extends ServiceImpl<ApArticleConfigMapper,ApArticleConfig> implements ApArticleConfigService {
    @Override
    public void updateMap(Map map) {
        Long articleId = (Long) map.get("articleId");
        Integer enable = (Integer) map.get("enable");
        ApArticleConfig apArticleConfig = getById(articleId);
        apArticleConfig.setIsDelete(enable==1?false:true);
        updateById(apArticleConfig);

    }
}
